home *** CD-ROM | disk | FTP | other *** search
- ## ftp_rput.tg
- # Multi-file, recursive Put with wildcards
- # script assumes:
- # 1. There is a temp/foo directory on the remote server.
- # 2. There is a c:\temp\foo local directory filled with all the files/directories you wish to Put.
- # 3. the environment variables: USER.SERVER, USER.USERID, and USER.PASSWORD are set elsewhere,
- # perhaps in the global (computer) environment or the local environment of WinCron via
- # Config.tg or AutoRun.tg. You could also set them here in this this script or hard-code the
- # values passed to -ftp connect.
-
- # put a file
- {
- -name ftp_rput
- -start
- -stop
- -action -print connecting to remote ftp server
- -action -onerror connect_fail
- -action -ftp connect handle %USER.SERVER% 21 %USER.USERID% %USER.PASSWORD%
- -action -print putting files on remote ftp server
- -action -onerror operation_fail
- -action -ftp rput handle c:\temp\foo\* temp/foo 0
- -action -ftp close handle
- -action -print done!
- }
-
- # connection failed
- {
- -name connect_fail
- -action -print FTP open connection failed with error:
- -action -print %TG.LAST_ERROR%
- -action -return abort
- }
-
- # operation failed
- {
- -name operation_fail
- -action -print FTP rput failed with error:
- -action -print %TG.LAST_ERROR%
- -action -print Closing connection.
- -action -ftp close handle
- -action -return abort
- }
-